using UnityEngine;
using System.Collections;

public class TransitionOnHitGround : CharacterAction
{
	public CharacterAnimatedState toState;
		
	public override void OnActionEnter (Character character)
	{ 
		character.onHitGround.OnEvent += OnHitGround; 
	}

	void OnHitGround (Character.HitGround message)
	{
		message.character.ToState(toState.stateName);
	}
	
	public override void OnActionExit (Character character)
	{
		character.onHitGround.OnEvent -= OnHitGround; 
	}
}

